package org.example.Lambda;

import java.util.function.IntConsumer;

/** @ClassName: LambdaDemo05 @Author NeySun @Description: TODO @Version 1.0 @Date 2022-03-03 */
public class LambdaDemo05 {
  public static void main(String[] args) {
    foreachArr(
        (int value) -> {
          System.out.println(value);
        });
  }

  public static void foreachArr(IntConsumer consumer) {
    int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    for (int i : arr) {
      consumer.accept(i);
    }
  }
}
